const {Schema} = require('mongoose')
const {createCrptoMd5} = require('../util/crypto')
module.exports = new Schema({
    account:{
        type:String,
        required:true
    },
    name:{
        type:String,
        default:null
    },
    email:{
        type:String,
        required:true
    },
    phone:{
        type:String,
        required:true
    },
    password:{
        type:String,
        required:true,
        select:false,
        set:(val)=>{
            return createCrptoMd5(val)
        }
    },
    headimg:{
        type:String,
        default:null
    }

})